#include "MovingObject.h"


MovingObject::MovingObject(void)
{

}

MovingObject::MovingObject(int x, int y, int Width, int Height, float vx, float vy, int deltaTime, LPD3DXSPRITE spriteHandler, LPDIRECT3DTEXTURE9 image):GObject(x,y,Width,Height)
{
	this->_vx = vx;
	this->_vy = vy;
	this->_deltaTime = deltaTime;

	this->_enablePushBackVector = false;

	this->_PushBackVector = Vector();
	/*DirectX *dx = new DirectX();
	LPDIRECT3DTEXTURE9 image = dx->LoadTexture(imgSrc,D3DCOLOR_XRGB(255,0,255));*/
	//this->_sprite = new Sprite(spriteHandler,50,50,10,5,image,30);
	int i = 0;

	this->_isMovable = true;
}

MovingObject::MovingObject(float x, float y, float vx, float vy, int deltaTime,int resourceName,CResourceManager *rm):GObject(x,y,resourceName,rm)
{
	this->_vx = vx;
	this->_vy = vy;
	this->_deltaTime = deltaTime;
	this->_isMovable = true;
}

void MovingObject::setPushBackVector(const Vector &v)
{
	_enablePushBackVector = true;
	_PushBackVector = v;
}

Vector MovingObject::getPushBackVector()
{
	return _PushBackVector;
}

Vector MovingObject::getVelocityVector()
{
	return Vector(_vx,_vy);
}

void MovingObject::setVelocity(Vector v)
{
	_vx = v.getX();
	_vy = v.getY();
}

MovingObject::~MovingObject(void)
{
	delete _sprite;
}